import request from '@utils/request'

// 分页
export function getFlowList (query) {
  return request({
    url: '/manager/list',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 变更流程状态
export function changeState (query) {
  return request({
    url: '/manager/change-state',
    method: 'post',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除部署流程
export function deleteDeployment (query) {
  return request({
    url: '/manager/delete-deployment?deploymentIds='+query.deploymentIds,
    method: 'post',
    data: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 流程节点进程图
export function modelView (query) {
  return request({
    url: '/process/model-view',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 获取申请人信息
export function getStuInfo (data) {
  return request({
    url: '/work/get-info',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}